]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
shell-global.c: remove a log message about missing 'Categories' key in the desktop...
authorMarina Zhurakhinskaya <marinaz@src.gnome.org>
Thu, 22 Jan 2009 21:28:19 +0000 (21:28 +0000)
committerMarina Zhurakhinskaya <marinaz@src.gnome.org>
Thu, 22 Jan 2009 21:28:19 +0000 (21:28 +0000)
main.js: set desktop environment to "GNOME" so that GIO can determine correctly which applications should be shown in the menus.

appDisplay.js: filter out applications that should not be shown in the menus, check if get_executable() for GAppInfo is not null before using it

svn path=/trunk/; revision=163

js/ui/appDisplay.js
js/ui/main.js
src/shell-global.c

index e897eb7a340a2bbab7a8b0f914852d541a67ee80..7a5f59e020d037477feecbd3c25e8aa08b5c108d 100644 (file)
@@ -142,6 +142,10 @@ AppDisplay.prototype = {
         let apps = Gio.app_info_get_all();
         for (let i = 0; i < apps.length; i++) {
             let appInfo = apps[i];
+            
+            if (!appInfo.should_show())
+                continue;
+            
             let appId = appInfo.get_id();
             this._allItems[appId] = appInfo;
             // [] is returned if we could not get the categories or the list of categories was empty
@@ -195,10 +199,14 @@ AppDisplay.prototype = {
                 return true;
         }
 
-        let exec = itemInfo.get_executable().toLowerCase();
-        if (exec.indexOf(search) >= 0)
-            return true;
-        
+        if (itemInfo.get_executable() == null) {
+            log("Missing an executable for " + itemInfo.get_name());
+        } else {
+            let exec = itemInfo.get_executable().toLowerCase();
+            if (exec.indexOf(search) >= 0)
+                return true;
+        }
+
         // we expect this._categories.hasOwnProperty(itemInfo.get_id()) to always be true here     
         let categories = this._categories[itemInfo.get_id()]; 
         for (let i = 0; i < categories.length; i++) {
index 18ade8b8141afdab24fdbb1929311f32fe14922f..272b559a6b55a48d32507b0b15d76e5c9df7f579 100644 (file)
@@ -2,6 +2,7 @@
 
 const Clutter = imports.gi.Clutter;
 const Shell = imports.gi.Shell;
+const Gio = imports.gi.Gio;
 const Signals = imports.signals;
 const Mainloop = imports.mainloop;
 const Tweener = imports.tweener.tweener;
@@ -104,7 +105,9 @@ Signals.addSignalMethods(ClutterFrameTicker.prototype);
 
 function start() {
     let global = Shell.Global.get();
-    
+
+    Gio.DesktopAppInfo.set_desktop_env("GNOME");
+
     global.grab_dbus_service();
     global.start_task_panel();
 
index c6ad467d17572eccc00e1e66a1622797feee8c03..af2868409e326f4f8017df730f494f6bc084bd2d 100644 (file)
@@ -378,7 +378,7 @@ shell_get_categories_for_desktop_file(const char *desktop_file_name)
                                                  &error);
         if (error != NULL)
           {
-            g_warning ("Error when getting 'Categories' from a key file %s: %s", desktop_file_name, error->message);
+            // "Categories" is not a required key in the desktop files, so it's ok if we didn't find it
             g_clear_error (&error);
           } 
       }